package web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import pojo.Dept;
import pojo.User;

import service.DeptService;

import service.UserService;

import java.util.List;

@Controller
public class UserServlet {

    @Autowired
    private UserService userService;

    public void addUser(User user){

        userService.addUser(user);

    }

    public void updateUser(User user) {
        userService.updateUser(user);
    }

    public void deleteUser(int id){
        userService.delete(id);
    }

    public List<User> findUserAll(){
        return userService.findUserAll();
    }
    public User findUserById(int id){
        return userService.findUserById(id);
    }





}
